Method And Apparatus For Error Detection In A Communication System

ABSTRACT

A method processes a data packet in a first sequence of disjoint original segments of the same length. The method includes modifying a first of the original segments of the first sequence by modifying one or more symbols therein. A start of the data packet is located in the first of the original segments and is positioned after a first digital data symbol therein. The method also includes modifying a last of the original segments of the first sequence by modifying one or more digital data symbols therein. An end of the data packet is located in the last of the original segments and is located before the last digital data symbol therein. The method also includes determining a remainder sequence by effectively performing a polynomial division on a second sequence of disjoint segments that are derived from the first sequence. Each segment of the second sequence corresponds to and is derived from one of the original segments of the first sequence. The segments of the second sequence have the length of the original segments of the first sequence. A first of the derived segments of the second sequence is the modified first of the original segments. A last of the derived segments of the second sequence is derived from the modified last of the original segments.

This application claims the benefit of U.S. provisional patentapplication No. 61/198,309, filed Nov. 4, 2008.

BACKGROUND

1. Field of the Invention

This invention relates to detecting transmission related errors in apacket-based communication system.

2. Discussion of Art

This section introduces various aspects that may aid the reader inobtaining a better understanding of various aspects of the inventionsand should not be understood to include statements about what is priorart or what is not prior art.

One goal of communication systems is to ensure that messages received byintended recipients are unaltered copies of the transmitted messages.For that reason, communication systems often employ error detectiontechniques that enable a recipient to determine whether a receivedmessage was altered during transmission. One technique for detectingchannel-induced message errors is based on a cyclic redundancy check(CRC) code. A CRC code typically transforms a sequence of digital datasymbols, e.g., representing a data message, to produce a sequence ofdigital check symbols. The sequence of digital cheek symbols istransmitted with the sequence of digital data symbols and a recipientuses the sequence of digital check symbols to evaluate whether thereceived sequence of digital data symbols is the same sequence that wasoriginally transmitted.

Some systems generate such a sequence of digital check symbols anddetect transmission errors from the transmitted sequence of digitalcheck symbols by using a feedback shift register. For example, a binaryCRC code can be implemented with a shift register that is controlled byfeedback via exclusive-OR (XOR) logic. The contents of memory elementsof the shift register typically correspond to a remainder sequence thatis produced by the division of the sequence of digital data symbols by afixed generator polynomial. The remainder sequence is typically appendedto the end of the sequence of digital data symbols for transmission torecipients of the data packet. In such systems, the remainder sequenceis typically serially computed on a bit-by-bit basis prior totransmission of the data packet.

SUMMARY

One embodiment includes a method of processing a data packet that islocated in a first sequence of disjoint original segments. Each originalsegment of the first sequence has the same length. The method includesmodifying a first of the original segments of the first sequence bymodifying one or more symbols therein. A start of the data packet islocated in the first of the original segments and is positioned after afirst digital data symbol therein. The method also includes modifying alast of the original segments of the first sequence by modifying one ormore digital data symbols therein. An end of the data packet is locatedin the last of the original segments and is located before the lastdigital data symbol therein. The method also includes determining aremainder sequence by effectively performing a polynomial division on asecond sequence of disjoint segments that are derived from the firstsequence. Each segment of the second sequence corresponds to and isderived from one of the original segments of the first sequence. Thesegments of the second sequence have the length of the original segmentsof the first sequence. A first of the derived segments of the secondsequence is the modified first of the original segments. A last of thederived segments of the second sequence is derived from the modifiedlast of the original segments.

BRIEF DESCRIPTION OF THE DRAWINGS

Advantages of various, embodiments may become apparent upon reading thefollowing detailed description and upon reference to the drawings inwhich:

FIG. 1A schematically illustrates a digital data communications systemthat uses a CRC code for the detection of errors, e.g., errors producedby transmitting digital data packets over a physical communicationchannel;

FIG. 1B schematically illustrates methods of processing a sequence ofdigital data symbols to produce a final sequence for a CRC codeword,e.g., in the data communication system as illustrated in FIG. 1A;

FIG. 2 is a flow diagram illustrating a method of decoding a sequence-ofdigital data symbols, e.g., as illustrated in FIG. 1B, to determinewhether the transmission of the sequence caused an error, e.g., a methodfor use in the receiver illustrated in FIG. 3A;

FIG. 3 is a flow diagram illustrating a method of encoding a messageportion in a sequence of digital data symbols, e.g., as illustrated inFIG. 1B, to append a CRC check sequence thereto, e.g., a method for usein the transmitter illustrated in FIG. 1A;

FIG. 4A is a block diagram illustrating one embodiment of an encoder,e.g., for the transmitter illustrated in FIG. 1A, wherein the encoderappends a CRC check sequence to each data packet to be transmitted,e.g., using methods of FIGS. 1B and 3;

FIG. 4B is a block diagram illustrating one embodiment of a decoder,e.g., for the receiver of FIG. 1A, wherein the decoder evaluates whethera received data packet has an error based on a CRC check sequence, e.g.,using the methods illustrated in FIGS. 1B and 2;

FIG. 5 illustrates processing of an example data packet by one specificembodiment of the methods of FIGS. 1B, 2, and 3, e.g., in the encoderillustrated in FIG. 4A and/or the decoder illustrated in FIG. 4B;

FIG. 6 is a block diagram illustrating one embodiment of a combinedmasking unit and partial remainder appending unit that maybe used, e.g.,in some specific embodiments of the encoder and decoder illustrated inFIGS. 4A-4B;

FIG. 7 is a state diagram illustrating the operation of the combinedmasking unit and partial remainder appending unit illustrated in FIG. 6;and

FIG. 8 is a block diagram illustrating a specific embodiment of abackwards computation unit that may be used in some embodiments of theencoder illustrated in FIG. 4A.

DETAILED DESCRIPTION

Various embodiments relate to apparatus, systems, and methods for use insystems that detect transmission errors in digital data packet-basedcommunication systems.

FIG. 1A illustrates one example of a communication system 10 thattransmits information in digital data packets. The communication system10 includes a transmitter 12, a receiver 14, and a physicalcommunication channel 16 connecting the transmitter 12 to the receiver14. The transmitter 12 includes an input data processor 18 and anencoder 400A. The data processer 18 receives data for transmission andproduces therefrom a stream of data digital packets. Each digital datapacket may have, e.g., a header, a message portion, and a reservedportion. The encoder 400A inserts a CRC cheek sequence in the reservedportions of one or more of the data packets prior to their transmissionto the physical communication channel 16. The receiver .1.4 includes adecoder 400B and an output data processor 20. The decoder 400B checksroe received data, packets for transmission errors, i.e., based on theCRC check sequences therein, and indicates the data packets found tohave an error to the output data processor 20.

The output data processor 20 may extract data from the message portionsof the data packets that, were found to be error-free by the decoder400B. The receiver 14 may be configured to signal the transmitter 12 tore-transmit data packets found by the decoder 400B to have transmissionerrors. The physical communication, channel 16 supports datacommunication between the transmitter 12 and the receiver 14. Thephysical communication channel 16 may include one or more, conventionaloptical fiber transmission lines, wireless transmission media, and/orwire transmission media, or a combination thereof. The communication,system 10′ may be configured to provide additional packaging of datapackets and/or overhead for other methods of error detection and/orcorrection, e.g., in addition to CRC cheek sequence-based methods.

FIG. 1B schematically illustrates methods of processing streams ofdigital data-symbols in a communication system that use a binary CRCcode to detect data transmission errors, e.g., steps of the method maybe performed in the transmitter 12 and/or receiver 14 of FIG. 1A.

The method involves operating on a first sequence 32 that includes atotal of (a+k+m+b) digital data symbols. The first sequence 32 is formedof consecutive segments of equal length. The first sequence 32 includesa sequence 34 of length (k+m) that forms the message and reservedportions of a data packet-of-interest. The message portion is faithfullyrepresented by a polynomial U(t), and the reserved portion is faithfullyrepresented by a polynomial F(t). In the first sequence, the messageportion is preceded by a sequence of “a” data symbols, and the reservedportion is followed by a sequence of “b” data symbols.

The method includes masking the first sequence 32 to produce a secondsequence 36 that is faithfully represented by a polynomial V(t). In afirst embodiment, the masking produces the second sequence 36 by settingto zero those bits of the first sequence 32 that are not located in themessage or reserved portions of the data packet. In an alternate secondembodiment, the masking produces the second sequence 36 by performingthe masking step of the first embodiment and also forming onescomplements of the first “m” bits of the message portion and the “m”hits of the reserved portion in the first sequence 32. In FIG. 1B, thetwo embodiments are indicated schematically by showing an insertion of“+I(t)” under appropriate bit locations of the data packet, i.e., toillustrate the extra masking operation of the second embodiment.

The method includes computing a value of a remainder sequence from thedivision of the masked second sequence 36 by the sequence thatcorresponds to the CRC generator polynomial G(t). The remainder is asequence that is faithfully represented by a polynomial R^((b))v(t). Atthe receiver, the computed value of the remainder sequence is indicativeof the absence or presence of some types of data transmission, errors inthe received data packet.

In embodiments for encoding, the method includes producing a thirdsequence 38 that will be transmitted from the transmitter to thereceiver. The third sequence 38 is formed by replacing the reservedportion 40 of the data packet by a CRC check sequence (in theabove-described first embodiment) or a ones complement of such a CRCcheck sequence (in the above-described first embodiment). Herein, theCRC check sequence or ones complement thereof are represented by apolynomial “F(t)+(D)(t)” where the polynomial F(t) faithfully representsthe

original sequence in the reserved portion in the first sequence 32 andD(t) represents the adjustment sequence that causes 34 to become acodeword. Below, steps illustrated in FIG. 1B and notations therein aredescribed in more detail.

Herein, a data packet contains disjoint message and reserved portions,wherein both of said portions are formed by finite sequences of digitalsymbols in a finite symbol alphabet

.

The alphabet

may be a finite Galois field, e.g., the mod 2 integers or strings of 1'sand 0's of a fixed preselected length. The message portion is a streamof k digital symbols u_(k−1)u_(k−2) . . . u₁ u₀ which is faithfullyrepresented as an order-k polynomial U(t) of the form:

U(t)=u _(k−1) t ^(k−1) +u _(k−2) t ^(k−2) + . . . +u ₁ t+u ₀.

In the polynomial U(t), the power of “t” determines the temporalposition of the corresponding digital symbol in the first stream. Thereserved portion may be located, e.g., immediately after the messageportion. Prior to encoding, the reserved portion holds a stream of mdigital symbols f_(m−1)f_(m−2) . . . f₁f₀, which is faithfullyrepresented by an order -m polynomial F(t) of the form:

F(t)=f _(k−1) t ^(m−1) +f _(m−2) t ^(m−2) + . . . +f ₁ t+f ₀.

Encoding rewrites the reserved portion of the data packet with a CRCcheck sequence portion of fixed length “f” or a ones complement thereof.The CRC check sequence has the form c_(m−1) c_(m−2) . . . c₁c₀ ε

^(m), which is faithfully represented by a CRC check sequence polynomialof the form:

C(t)=c _(m−1) t ^(m−2) +c _(m−2) t ^(m−2) + . . . +c ₁ t+c ₀.

In first embodiments, e.g., as described with respect to FIG. 1B, thecorresponding message and CRC check sequence portions form a codeword ofsymbol length n=k+m, which is faithfully represented by a polynomial,X(t), which satisfies:

X(t)=U(t)·t ^(m) +C(t).

In the polynomial X(t), higher-order “t” terms, correspond to thedigital data symbols of the message portion of the-digital data packetitself and lower-order “t” terms, correspond to the digital symbols ofthe CRC check sequence portion of the digital data packet.

Herein, a codeword refers to a polynomial in “t” that is exactlydivisible by a preselected and fixed CRC generator polynomial in “t”,the polynomial is divisible without a non-zero remainder. Thepreselected and fixed CRC generator polynomial G(t) may be written as:

G(t)g _(m) t ^(m) +g _(m−1) t ^(m−1) +g _(m−2) t ^(m−2) + . . . +g ₁ t+g₀, where g _(m−1) g _(m−2) . . . g ₀ε

, G ₀≠0 and g_(m)≠0.

For example, a useful CRC generator polynomial G(t) is the special CRCgenerator polynomial:

G(t)=t ³² +t ²⁶ +t ²³ +t ²² +t ¹⁶ +t ¹² +t ¹¹ +t ¹⁰ +t ⁸ +t ⁷ +t ⁵ +t ⁴+t ² +t+1.   (1)

The special CRC generator polynomial of Equation (1) is known as theCRC-32 polynomial and is specified by several standards, e.g., the IEEE802.3 Ethernet standard. Various embodiments of methods and apparatusdescribed herein, may be configured to use the CRC-32 polynomial oranother polynomial as the CRC generator polynomial.

In such, first embodiments, the CRC check sequence polynomial C(t) ischosen such that U(t)·t^(m)+C(t) is divisible by the CRC generatorpolynomial G(t), i.e., such that U(t)·t^(m)+C(t) is a codeword. Inparticular, the remainder R(t) of division of U(t)·t^(m) by the CRCgenerator polynomial G(t) is defined by:

$\begin{matrix}{{R(t)} = {{{remainder}( \frac{{U(t)} \cdot t^{m}}{G(t)} )}.}} & (2)\end{matrix}$

Here, the remainder polynomial R(t) corresponds to a digital symbolsequence r_(m−1)r_(m−2) . . . r₁r₀. Thus, the CRC cheek sequencepolynomial may satisfy C(t)=−R(t) where the minus of any coefficient isthe additive inverse of the coefficient in the algebra

. In a binary CRC code, −R(t )=R(t), because the algebra

of a binary CRC code is the integers modulo 2 and 1+1=0 for the integersmodulo 2. Thus, the CRC check sequence polynomial is R(t) for thisalgebra.

In a data communications system using such an implementation of a CRCcode, the transmitter, e.g., the transmitter illustrated in FIG. 1A,sends a stream of digital data symbols. In the stream, each transmitteddigital data packet includes a separate message portion and a CRC checksequence portion that together correspond to a codeword X(t). Eachdigital data packet may also include a separate packet header and/orpacket container, which are not part of the message and CRC checksequence portions of the data packet. In response to the transmission ofthe data packet corresponding to fee codeword X(t), the receiverreceives a sequence of digital data symbols that corresponds to apolynomial Y(t), where Y(t)=X(t)+E(t). Here, E(t) is a

polynomial faithfully representing the locations and values of theerrors in the received data packet. To determine whether a transmission,error has occurred, the receiver, e.g., the receiver 14 as illustratedin FIG. 1A, evaluates a remainder of a polynomial division of Y(t) bythe CRC generator polynomial in the absence of any transmission errors,the remainder of Y(t) divided by the CRC generator polynomial G(t) is apolynomial with zero coefficients, i.e., Y(t) is a codeword. In thepresence of one or more transmission errors, the remainder of thisdivision is likely to he non-zero, i.e., an error is detectable unlessE(t) is itself a codeword. For example, for special generatorpolynomials of order m, any error sequence that is a cyclic shift of apolynomial of degree less than m produces a polynomial E(t) that is notcodeword. Thus, in a received data packet, such errors are detectablevia a determination of whether the corresponding polynomial Y(t) is acodeword.

In second embodiments, e.g., the second embodiment described withrespect to FIG. 1B, encoding includes initializing the “m” memoryelements that will hold the remainder R(t) with an all-ones sequence andeffectively evaluating a remainder R(t) of the polynomial division ofthe polynomial U(t)·t^(m)+I(t)·t^(k) by the CRC generator polynomialG(t) where I(t)=t^(m−1)+t^(m−2)+ . . . +t+1. Thus, the polynomial R(t)satisfies:

$\begin{matrix}{{R(t)} = {{{remainder}( \frac{{{U(t)} \cdot t^{m}} + {{I(t)} \cdot t^{k}}}{G(t)} )}.}} & (3)\end{matrix}$

In these second embodiments, the transmitted portions of a thirdsequence for the message and reserved portions of the data packet arefaithfully represented by a codeword X(t) that satisfiesX(t)=U(t)·t^(m)+C(t) where C(t)=R(t)+I(t)=F(t)+D(t). Herein, for thesesecond embodiments of crc coding, a data packet is faithfullyrepresented by a polynomial, that is a codeword if dividing thepolynomial by the crc generator polynomial G(t) produces an all-onespolynomial of order “m” where the reserved portion of the data packethas length “m”. Thus, the receiver may initialize memory elementsspecifically for the crc check sequence with an all-ones, sequence andthen determine whether the remainder of a polynomial division of thereceived sequence corresponding to Y(t), i.e., X(t)+E(t), by the crcgenerator polynomial G(t) produces an all-zeros sequence to decidewhether the data packet has a transmission error.

The medium access control (MAC) layer in the IEEE 802.3 standard usesthis alternate procedure with the standard CRC-32 generator polynomialG(t) of Equation (1).

FIGS. 2 and 3 illustrate methods 200, 300 for processing data packetsthat are based on a cyclic redundancy code (CRC) over the binary algebradefined by modulo addition on 0 and 1. The encoding method 300 involvespreparing each data packet tor transmission by evaluating a CRC checksequence for a message portion of the data packet and appending a CRCcheck sequence or a ones complement thereof to the message portion,e.g., in the encoder 400A illustrated in FIG. 1A. The appending stepforms a sequence that corresponds to a CRC codeword. The decoding method200 involves determining whether a received data packet has aCRC-detectable transmission error by determining whether the data packetcorresponds to a CRC codeword, e.g., in the decoder 400B illustrated inFIG. 1A. The definitions of “codeword” have already been described withrespect to the first and second embodiments of FIG. 1B.

At steps 210 and 310, the methods 200, 300 include, in asegment-by-segment manner, receiving segments of a first sequence thathas a digital data packet therein, e.g., the receiving may be performed,in the encoder 400A or the decoder 400B as illustrated in FIG. 1A. Thefirst sequence is a sequence of “q” segments, wherein each segment hasthe same length “s”.

Each, first sequence includes a message portion of the data packet,whose sequence of bits corresponds to a polynomial U(t), and a reservedportion of the data packet, whose sequence of bits corresponds to apolynomial F(t), i.e., in these methods 200, 300 of FIGS. 2-3. Thereserved portion may immediately follow the message portion of the datapacket. The message and reserved portions are typically located in themessage portion of the data packet, e.g., after the packet header. Inthe first sequence, “a” bits precede the sequence corresponding to U(t)t^(m)+F(t), and “b” bits follow the sequence corresponding to U(t)t^(m)+F(t). Thus, q·s=n+a+b where “q” is the number of segments in thefirst sequence, “s” is the number if bits in a segment:, and “n” is thenumber of bits in the sequence corresponding to U(t) t^(m)+F(t).

Here, the values of the integers “a”, “b”, and “n” may vary from datapacket to data packet due to the different possible locations of a datapacket in the first sequence and different possible lengths of a datapacket. In the examples described below, the length of each segment isshort enough, to ensure that message portions of no more than twoconsecutive data packets, are located in the same segment. In some otherembodiments, the segments may be longer so that a part of the messageportion of one data packet, message portion(s) of zero, one or moresubsequent data packets, and part of the message portion of another datapacket may be in one segment.

At steps 220 and 320, the methods 200, 300 include sequentially maskingthe “q” segments of the first sequence as the segments are received,e.g., the masking may be performed in the encoder 400A or the decoder400B as illustrated in FIGS. 1A. In a segment-by-segment manner, themasking produces a second sequence of segments in which

i) the “a” bits preceding the sequence corresponding to U(t)t^(m)+F(t)are zeros, and

ii) the “b” bits following the sequence corresponding to U(t)t^(m)+F(t)are zeros.

In some specific embodiments, e.g., the above-described secondembodiments described with respect to FIG. 1B the masking steps 220 and330 also involve:

i) inverting the leading “m” bits of the sequence corresponding toU(t)t^(m)+F(t) and/or

ii) inverting the final “m” bits of the sequence corresponding toU(t)t^(m)+F(t).

These specific embodiments perform this option inverting (i.e., onescomplementing) of the initial “m” bits and final “m” bits of theconcatenation of the message and reserved portions of the data packet.In such embodiments, the second sequence of segments is faithfullyrepresented by a polynomial V(t) of the form:

V(t)=0·t ^(qδ−1)+ . . . +0·t ^(n+b)+(U(t)·t ^(m) +I(t)·t ^(k)+F(t)+I(t))·t ^(b)+0·t ^(b−1)+ . . . +0·t+0.   (4)

At steps 230 and 330, the methods 200, 300 involve processing the secondsequence, which corresponds to the polynomial V(t), in asegment-by-segment manner that corresponds to recursively dividing thepolynomial V(t) by the CRC generator polynomial G(t). The steps 230 and330 involve computing a remainder sequence corresponding to a polynomialR_(v) ^((b))(t) that is the remainder of a division of the polynomialV(t) by the CRC generator polynomial G(t). Thus, the processing steps230, 330 effectively perform a division of V(t) by the CRC generatorpolynomial G(t) rather than performing a division of the message portionU(t) of the data packet by the CRC generator polynomial G(t).

At step 240, the method 200 determines whether the portion of the firstsequence corresponding to the message and reserved portions of the datapacket form a CRC codeword based on the remainder computed at the step230. If this portion of the first sequence is determined to be acodeword, the method 200 includes signaling, at 250, that the datapacket is transmission error-free. If this portion of the .firstsequence is determined to not be a codeword, the method 200 includessignaling, at 260, that the data packet has a transmission error.

At step 340, the method 300 involves adjusting the reserved portion ofthe data packet such that the message and reserved portions of the datapacket form a sequence corresponding to a CRC codeword. The step 340 mayinvolve determining a sequence corresponding to a check sequencedifference polynomial D(t) and creating a final sequence for the messageand reserved portions of the data packet. The final sequence isfaithfully represented by the polynomial U(t)·t^(m)+D(t)+F(t).

In the above-described first embodiments, from the form of V(t), itfollows that:

$\begin{matrix}{{{R_{V}^{(b)}(t)} \equiv {{remainder}( \frac{V(t)}{G(t)} )}} = {{remainder}( \frac{{R(t)} \cdot t^{b}}{G(t)} )}} & (5)\end{matrix}$

If the sequence for the computed remainder polynomial R_(v) ^((b))(t) isan all-zeros

sequence of at least length m, then F(t)=C(t), and the step 340determines that D(t)=0. If instead, the computed remainder-polynomial.R_(v) ^((b))(t) R_(v) ^((b))(t) is a non-zero polynomial whose length isequal to or less than m, then C(t)=F(t)+D(t) where the non-zero checksequence difference polynomial D(t) satisfies:

$\begin{matrix}{{{remainder}( \frac{{D(t)} \cdot t^{b}}{G(t)} )} = {R_{V}^{(b)}(t)}} & (6)\end{matrix}$

Then, the step 340 may effectively involve solving Equation (6). via abackwards computation to obtain the symbol sequence for check sequencedifference polynomial D(t) from the computed

sequence for the computed remainder polynomial R_(v) ^((b))(t).

The step 340 may involve backwards computing the polynomial R_(v)^((b))(t) from the computed remainder polynomial R_(v) ^(b))(t) byrecursively solving another equation relating remainders R_(v) ^((i))(t)for different numbers “b” of trailing zeros in the sequence for thepolynomial V(t). In particular, the equations relating remainders can berewritten in a reverse-ordered form from the reverse-ordered generatorpolynomial. For example, R_(v) ^((i−δ))(t) can be obtained from aremainder involving R_(v) ^((i))(t) by solving the equation:

$\begin{matrix}{{{{R_{V}^{({i - \delta})}( t^{- 1} )} \cdot t^{m}} = {{{remainder}( \frac{{R_{V}^{(i)}( t^{- 1} )} \cdot t^{m + \delta}}{{G( t^{- 1} )} \cdot t^{m}} )}\mspace{14mu} {where}}}\mspace{20mu} {1 \leq \delta < {i.}}} & (7)\end{matrix}$

That is, coefficients of (i−δ)-th remainder polynomial R_(v) ^((i−δ))(t)are equal to a remainder obtained from dividing the i-th reverse-orderedremainder polynomial R_(v) ^((t))(t⁻¹)·t^(m+δ)by the reversed-orderfixed polynomial G(t⁻¹)·t^(m), i.e., G(t⁻¹)·t^(m)=g₀t^(m)+g₁t^(m−1)+ . .. +g_(m−1)t+g_(m). For this reason, the above described recursive

process can also be performed with reverse-ordered forms of remaindersto obtain D(t)=R_(v) ⁽⁰⁾(t) from the computed remainder polynomial R_(v)^((b))(t). For example, one method to

perform this computation for arbitrary a range of values of “b” in acertain range is described in more detail below in connection with FIG.8.

In the above-described second embodiments, the check sequence differencepolynomial D(t) is the difference between the polynomial R(t)+I(t) andthe-polynomial F(t), which corresponded to the reserved portion of thedata packet in the first sequence. The polynomial R(t)+I(t) correspondsto the ones complement of the remainder of a division of the polynomialU(t)+I(t)·t^((k−m)) for the message portion of the data packet by theCRC generator polynomial G(t). In this embodiment, the sequence for thepolynomial R(t) could also be found by

backwards calculations from the sequence for the computed remainderpolynomial R_(v) ^((b))(t) based on modified versions of Equations 6-8,which account for the Inversions in the polynomial V(t) as shown inabove Equation (4) for the second embodiments. A person of ordinaryskill in the art would be able to easily determine said modifiedequations based on the above descriptions of Equations 4-8.

At step 340, the method 300 also sequentially transmits to a destinationreceiver a final sequence in which the data packet has the originalmessage portion and in which the message and reserved portions form aCRC codeword faithfully represented by the polynomialU(t)·t^(m)+D(t)+F(t). In the below-described embodiments, a “word” istypically “one byte”.

FIGS. 4A and 4B illustrate an encoder 400A and a decoder 400B,respectively. The encoder 400A may, e.g., perform the encoding method300 of FIG. 3, and the decoder 400B may, e.g., perform the decodingmethod 200 of FIG. 2. The encoder 400A and decoder 400B are, e.g.,conventional digital hardware devices, e.g., formed of circuitsincluding gates, flip-flops, registers, adders, and/or multipliers. Theencoder 400A and decoder 400B illustrated in FIGS. 4A-4B may be, e.g.,the respective encoder 400A and decoder 400B illustrated in FIG. 1A. Theencoder 400A and/or decoder 400B may be located in a network interfacecard (NIC) or a transport network element (TNE), e.g., an Ethernet NICor TNE, of a transceiver for wired, wireless, or optical packet-basedcommunications.

As shown in FIGS. 4A and 4B, the encoder 400A and decoder 400B include aset of digital data processing units, The set of digital processingunits includes a segmenting unit 410; a: masking unit 420; a partialremainder appending unit 425; segment division units 430, 435; aremainder processing unit 440; and one or more digital buffers 460, 462,464, 466, The encoder also has a backwards computation unit 470 and acheck sequence adjustment unit 480. The decoder 4008 also has a check,sequence verification unit 490. Various ones of the digital processingunits process the received stream of data symbols in a substantiallytemporally sequential segment-by-segment manner in which each segmenthas the same length.

The segmenting unit 410 receives a stream of digital data symbols andconsecutively transmits each consecutive equal-length segment to themasking unit 420 and information on each -segment to the masking unit420 and the partial remainder appending unit 425. The segmenting unit410 receives the stream at input 401 and outputs segments of said streamat output 412. For each data packet, the segmenting unit 410 outputs asequence of “q” consecutive segments where “q” may vary from datapacket-to-data packet. But, each segment is S w bytes long, i.e., s bitswhere s=wS and w is the number of bits in a word. In the descriptionbelow, the segments are assumed to be byte-aligned. The results can beeasily extended to process segments that are not word-aligned.

For each segment, the segmenting unit 410 transmits informationcorresponding to the segment to output port 414. The informationidentifies and locates any data packet start and/or data packet endlocated in the corresponding segment. It a segment has a data packetstart, the segmenting unit 410 outputs a start-of-packet (SOP) signal ofthe value 1 and a start-of-packet index (SPI) that identifies theposition of the data packet start in the segment, if a segment does nothave a data packet start, the segmenting unit 410 outputs a SOP signalof the value 0. If a segment has a data packet end, the segmenting unit410 outputs an end-of-packet (FOP) signal of the value 1 and anend-of-packet index (EPI) that identifies the position of the datapacket, end in the segment. If the segment does not have a data packetend, the segmenting unit 410 outputs an EOP signal of the value 0. Thesegmenting unit 410 may identify and locate a data packet start and/or adata packet end by reading a packet length identifier (PLI) in thepacket header of the data packet.

Below, consecutive words of a segment are indexed in order oftransmission by numerals (S−1) to 0 where higher index, corresponds, toearlier transmitted words. The SPI and EPI signals may be represented bya vector of length “j” of binary signals (i.e., 2^(j−1)<S≦2^(j)) thatrepresent each index by a binary number. The value of SFI points, e.g.,to the first word for a message portion of a data packet, i.e., theportion corresponding to the polynomial U(t), and the value of EPIpoints, e.g., to the last word of the reserved or CRC check sequenceportion of a data packet.

The masking unit 420 masks bits of segments in a segment-by-segmentmanner as the segments are received from the segmenting unit 410 via theoutput 412. From each q segments of a first sequence, i.e., having anentire data packet therein, the masking unit 420 produces a secondsequence of corresponding segments, wherein the second sequencecorresponds to the polynomial V(t), which has already been described. Insuch a second sequence, the masking unit 420 sets to zero each bitoutside of the message and reserved portions of the data packet, i.e.,sets to zero each bit before the sequence corresponding toU(t)t^(m)+F(t) and sets to zero each bit after the sequencecorresponding to U(t)t^(m)+F(t). Thus, the masking unit 420 sets a first“a” bits of the first sequence to “0” and sets a last “b” bits of eachfirst sequence to “0”. In above-described second embodiments, themasking unit 420 also inverts (i.e., ones complements) the first “m”bits and the last “m” of the sequence corresponding to the concatenationof the message and reserved portions, i.e., the sequence correspondingto the polynomial U(t)t^(m)+F(t).

The masking unit 420 sequentially outputs each segment of the secondsequence to the partial remainder appending unit 425. The partialremainder appending unit 425 shifts a partial, remainder sequence oflength “m” so as to add the partial remainder to the sequence formed bymost significant “m” bits of each non-leading segment of the secondsequence. Here, each partial remainder sequence is a remainder from adivision, by one of the segment division units 430, 435 of the precedingsegment of the same second sequence by the sequence corresponding to theCRC generating polynomial G(t). Such partial remainders are fed back tothe partial remainder appending unit 425 from the remainder processingunit 440 via a line 441.

The segment division units 430,435 operate on each received segment in asequential Segment-by-segment manner, e.g., each segment correspondingto a segment of the masked polynomial V(t). Via the segment-by-segmentdivisions, the segment division unit(s) 430,435 output(s) a sequence ofthe partial remainders. Since the segment division units 430, 435receive non-leading segments that are combined with an appropriatelyshifted partial remainder from previous segment divisions, the finalpartial remainder, i.e., produced in one of the segment division units430, 435 by the division of the last, segment of the second sequence,corresponds to the sequence for the remainder polynomial R^((b))v(t).That is, the final partial remainder sequence output, by the segmentdivision unit(s) 430, 435 corresponds to the remainder that would beproduced by dividing the masked polynomial V(t) by the CRC generatorpolynomial G(t).

In some embodiments, the partial remainder appending unit 425 outputsthe set of segments of the second sequence to one segment division unit430, 435 and outputs the segments for the next second sequence to theother segment division unit 435, 430. In these embodiments, one of thesegment division units 430, 435 performs a division of each such segmentof one data packet by the CRC generating polynomial G(t), and the othersegment division unit 435, 430 performs a division of each such segmentfor the next data packet in the stream by the CRC generating polynomialG(t).

In other embodiments, the partial remainder appending unit 425selectively transmits the segments to the segment division units 430,435 based on the amount of the segment occupied by the data packet beingprocessed. In particular, if the segment has a data packet end, and thecurrent data packet, has more bits therein than the next data packet,the segment of the current data packet will be transmitted to the firstsegment division unit 430, and a shortened segment having-the next datapacket will be transmitted to the second segment division unit 435.Otherwise, if the current data packet has fewer bits than the next datapacket, the segment of the next data packet will be transmitted to thefirst segment division unit 430, and a shortened segment having theremainder of the current data packet will be transmitted to the secondsegment division unit 435.

The remainder processing unit 440 routes the sequence for the remainderpolynomial R^((b))v(t) to output 442 for further processing. The furtherprocessing may be performed by the

check sequence verification unit 490 or by the backwards computationunit 470. For each data packet, the remainder processing unit 440selects the sequence for the remainder polynomial R^((b))v(t) from oneof the segment division units 430, 435 based on the SOP, SPI, EOP, andEPI information for the corresponding data packet. As already described,the remainder processing unit 440 also feeds partial remainders from thesegment division units 430, 435 hack to the partial remainder appendingunit 425.

In the above-described second embodiments, a special situation occurswhen the end of the reserved portion of a data packet is located nearthe start of the last segment of the second sequence. In suchsituations, the remainder processing unit 440 may be configured to add acorrection term to the partial remainder evaluated by one of the segmentdivision units 430, 435 for the last segment of the second sequence.More specifically, the correction term compensates for the one or morebytes that should have been inverted but were not inverted in thenext-to-last segment of the second sequence when the correspondingpartial remainder was computed. The correction term is the remainderthat results from dividing the appropriately shifted missed onessequence of the next-to-last segment by the CRC generator polynomialG(t). A person of ordinary skill in the art would be able to readilyfabricate a look up table or combinatorial circuit that the remainderprocessing unit 440 would be able to use to apply such correction termsin these special situations.

In some embodiments (not illustrated in FIGS. 4A-4B), the partialremainder appending unit 425 is absent and the masking unit 420sequentially outputs each segment of the second sequence directly to oneof the segment division units 430, 435. Then, the remainder processingunit 440 modifies the final partial remainder produced by the divisionsin the segment division unit(s) 430, 435 of the last segment of the.second sequence by the sequence corresponding to the CRC generatingpolynomial G(t). In particular, the modification involves

adding a correction computed from the partial remainders for divisionsof the earlier segments of the second sequence by the segment divisionunits 430, 435. The adjustment corrects the final partial remainder sothat the remainder processing unit 440 will still output at the port 442a remainder sequence corresponding to the remainder polynomialR^((b))v(t). i.e., the remainder obtained by dividing the masked secondsequence V(t) by the CRC generator polynomial G(t).

In the masked second sequence, there may be trailing fixed digital datasymbols that are not part of the corresponding data packet, e.g.,entries corresponding to trailing “0” of the polynomial V(t). As alreadydiscussed, the remainder sequence for the polynomial R^((b))v(t), ascalculated from the masked sequence for the masked polynomial V(t), maynot correspond to the CRC remainder polynomial C(t) for the data packetitself. Thus, for some of the data packets, the backwards computationunit 470 may perform a backwards calculation of the correct CRCremainder sequence for the CRC remainder polynomial R(t) or a differencesequence for the check sequence difference polynomial D(t), e.g., asdiscussed above. In the backwards computation unit 470, thesecalculations are based on the length “m” remainder polynomialR^((b))v(t), which are received from the output port 442 of theremainder processing unit 440. Such backwards calculations are alsobased on the known fixed forms of the “b” trailing zeros in the sequencefor V(t), as already described, i.e., as known from the EOP and EPIsignals received

by the backwards computation unit 470 from line 465.

In the encoder 400A, the backwards computation unit 470 outputs the CRCcheck sequence for the CRC remainder polynomial R(t) or the differentsequence for the check sequence difference polynomial D(5) to the checksequence adjustment unit 480 via output port 472.

In the encoder 400A, the check sequence adjustment unit 480 inserts thebackwards calculated check sequence R(t) into the reserved portion ofthe corresponding data packet to produce a transformed first sequencefor transmission to the physical communication channel. In thetransformed first sequence, the sequence for the message and reservedportions of the data packet is faithfully represented by the polynomial.U(t)·t^(m)+F(t)+D(t) rather than by the input, sequence which wasfaithfully represented by the polynomial U(t)·t^(m)+F(t). Thetransformed first sequence is outputted at output port 482. For eachdata packet, the check sequence adjustment unit 480 receives thesequence for the polynomial R(t) or D(t) from the output port 472 of thebackwards computation unit 470.

The check sequence adjustment unit 480 and the backwards computationunit 470 receive segments of the data packet at appropriate, times viadata line 469. The data line includes buffers 460, 466 that providedelays of appropriate length. The check sequence adjustment unit 480,backwards computation unite 470, and the remainder processing unit 440receive EOP, EPI, SOP, SPI signals for data packets at appropriate timesvia data line 469. The control line 465 includes buffers 462, 464 thatprovide delays of appropriate length.

In the decoder 400B, the check sequence verification unit 490 outputs acontrol signal at output 492 that, indicates whether a correspondingdata packet is a codeword. The check sequence verification unit 490determines the value of the control signal to be outputted based on theform of the sequence for the polynomial R^((b))v(t) that is receivedfrom the remainder

processing unit. 440, If the polynomial R^((b))v(t) is the all-zerospolynomial of length, “m”, the check sequence verification unit 490typically outputs a signal indicating that the corresponding data packetis transmission error-free. But, if the polynomial R^((b))v(t) isanother polynomial of length “m”, the check sequence verification unit490 typically outputs a signal indicating that the corresponding datapacket has transmission error.

To briefly summarize, in the encoder 400A, the masking unit 420transforms a first sequence of segments from the segmenting unit 410into a second sequence of masked, segments that correspond to the maskedpolynomial V(t), e.g., Equation (5). In the encoder 400A, the segmentdivision units 430, 435 and the remainder processing unit 440 togethergenerate a sequence of segments corresponding to the remainderpolynomial R^((b))v(t), e.g., according to Equation (6). The backwardscomputation, unit 470 effectively determines the CRC check sequenceadjustment polynomial D(t) or the CRC remainder polynomial R(t) from theremainder polynomial R_(v) ^((b))(t), e.g., based on Equation (9), andthe sequence for this polynomial may be used further in the checksequence adjustment unit 480.

In alternate embodiments, other digital devices may replace thecombination of the masking unit 420, partial remainder appending unit425, segment division units 430,435, and remainder processing unit 440.For instance, if a segment contains parts of at most one data packet, itmay not be-necessary to have either two segment division units 435, 430and/or the remainder processing unit 440.

As described, above, one or more of the embodiments described hereinrelate to systems or methods for generating a CRC check sequence for adata packet and writing the generated CRC sequence or a ones complementthereof into the data packet prior to transmission.

Example of Segment Processing and Other Example Embodiments

FIG. 5 illustrates the processing of an example data packet via someembodiments of the encoder 400A of FIG. 4A. The data packet is locatedin a first sequence 510 of digital data symbols that is formed of fourconsecutive, disjoint, equal length segments 522, 524, 526, 528, Theprocessing includes generating a second sequence of masked segments 570and computing a CRC check sequence 580 from the second masked sequenceof segments. Below, the processing will be described in relation to FIG.6, which is block diagram of an example of the masking unit 420 and thepartial remainder appending unit 425 of FIG. 4A. The masking unit 420the partial remainder appending unit 425 are operated based on a finitestate machine (FSM) 700 shown in FIG. 7.

In FIG. 5, the first sequence 510 of four segments 522, 524, 526, 528includes the data packet, which has a message portion 514 and a reservedportion 516 for the CRC check sequence. The first and fourth segments522, 528 have portions 512, 518 that do not belong to the data packet,i.e., the data and reserved portions 514, 516 of the data packet.

FIG. 5 illustrating processing the segmenting unit 410, the masking unit420, the partial remainder appending unit 425, the segment divisionunits 430, 435, the remainder processing unit 440, and the backwardscomputation unit 470 of FIG. 4A. The segmenting unit 410 sequentiallyoutputs the segments 5.22, 524, 526, 528 of the first sequence 510 andinformation defining positions of ends and starts of data packetstherein to the masking unit 420. The masking unit 420 sequentiallytransforms the segments 522, 524, 526. 528 of the first sequence 510into masked segments 536,546, 556, 556 of the second sequence 570. Thetransforming involves masking initial, and final portions 512, 518 ofthe first sequence 510, which are not in the data packet, to zero, i.e.,6 bytes each, and may include ones inverting the same number of initialand final bytes of the data packet, i.e., 4 bytes each in the example(inversion of a byte is indicated by a dash). The partial remainderappending unit 425 adds intermediate or partial remainders 538, 548, 558from earlier polynomial divisions of the leading segments 522, 524, 526,i.e., in segment division units 430, 435, to most significant bytes ofthe non-leading segments 524, 526, 528. In such embodiments, the partialremainders 538, 548, 558 are fed back to the masking unit 420 via theremainder processing unit 440 or via the segment division unit(s) 430,435. Each segment, division unit 430, 435 divides each masked segment536. 546, 556, 566, i.e., with an appended partial remainder for thenon-leading masked segments 524, 526, 528, by a sequence correspondingto. the CRC generating polynomial G(t) thereby producing the partialremainders 538, 548, 558, 568. The remainder processing unit 440 outputsthe last segment's remainder 568, which corresponds to the remainderpolynomial R^(b))v(t) to the backwards computation unit 470. Thebackwards computation unit 470 computes the CRC check sequence 580corresponding to the CRC remainder polynomial. R(t) or the CRCdifference sequence corresponding to the difference polynomial D(t) fromthe last segment remainder 568.

FIGS. 6 and 8 illustrate specific embodiments of the masking unit 420,the partial remainder appending unit 425, and the backwards computation,unit 470 of FIGS. 4A-4B.

Referring to FIG. 6, the segmenting unit 410 transmits: segments oflength s, i.e., Sw or 20 bytes; in FIG. 5, to masking modules 620, 630,640 of the masking unit 420, The masking unit 420 may also include amask generation module 610 that receives information about positions ofending and starting segment indices of data packets.

The mask generation module 610 interprets this information according tothe example finite state machine (FSM) 700 that is illustrated in FIG.7. At initialization, the FSM is in the INIT/IDLE state 710. The FSMremains in the INIT/IDLE state as long as the received values of SOP are“0”. If a later received (SOP, FOP) pair indicates that SOP=1 and EOP=0,the corresponding segment has a start of a data packet, e.g., thesegment 522 of FIG. 5. The FSM changes to the Packet-Begin (PB) state720 if the data packet does not also have an end of a data packet, e.g.,as in segment 522 of FIG. 5. The FSM changes to the Packet-Full (PF)state 760 if the segment also has an end of data packet, i.e., if EOP=1.In the PB state 720, the masking unit 420 of FIG. 6 sets any initialpart of the segment that is outside of the data packet to a zerosequence and inverts the first m bits of the data packet itself e.g.,mw=4 bytes in FIG. 5. To perform these transformations, the maskgeneration module 610 produces masks M^((S)) and X^((S))

to have forms defined by the received value of the SPI signal. If thevalues of SOP and EOP are zero in the next segment, e.g., the segment524 of FIG. 5, the FSM changes to the Packet-Middle (PM) state 730. Thefirst time that the FSM is in the PM state, the encoder determineswhether the data packet started at the end of the last segment so thatany remainder of the mask X^((S)) for the previous segment is fed tomasking unit 620 to invert first words of the current segment (at most(m/w)−1) words are to be inverted as specified by X_(p) ^((S)).Otherwise, the PM state typically does not perform masking of segments.The FSM 700 will remain in state PM 730 until the value of BOP changesto 1 to indicate that an end of packet is located in a segment.

The FSM remains in the PM state 730 until the value of EOP changes to 1.If the value of SOP is still zero, the FSM changes to the Packet-End(PE) state 740 in response to HOP changing to 1. For the PH state 740,the mask generation module 610 .produces two masks M^((E)) and X^((E)),which are fed to the masking module 620 to set the portion of thesegment outside of the data packet to zero and to bit-wise invert aportion of length m at the end of the data packet. If the value of SOPchanges to 1 along with EOP, the segment contains the end of the datapacket being processed and the start of the next data packet. Suchvalues of EOP and SOP cause the FSM to change to the Packet-Double (PD)state 750 in which both segment division units 430, 435 are used.

In the PD state 750, there are two processing cases. In the first case,the segment has an end portion of a data packet that is longer than thestart portion of the next data packet in the segment. In this case, theend portion, of the data packet is processed in the masking module 620like in the PE state 740 and the segment division unit 430 uses themasks M^((E)) and X^((E)). In this case, the starting portion of the newdata packet, which has less than H words, is processed in parallel inthe masking module 640 and the segment division unit 435, i.e., usingthe H least significant bits of the masks M^((S)) and X^((S)) in asimilar fashion as in the PB state 720. In the second case, the segmenthas an end portion of a data packet that is shorter than the startportion of the next data packet in the segment. In this case, the end ofthe data packet, which has less than H words, is processed in themasking module 630 and the segment division unit 435 using the H mostsignificant bits of the two masks M^((E)) and X^((E)) similarly to thePE state 740. In this case, the starting portion of the new data packetis processed, similarly to the PB state 720, in the masking module 620and the segment division unit 430 using the two masks M^((S))andX^((S)).

Finally, if the FSM 700 is in the INIT/IDLE state 710 or the PE state740 and the values of SOP and EOP both become 1, the FSM changes to thePF state 760. In the PF state 760, the entire packet is contained in onesegment. In this case, the segment is modified in the masking module 620by application of the four masks M^((S)), X^((S)), M^((E)), and X^((E)),and the CRC remainder is determined by the segment division unit 430.

The FSM 700 may include simultaneously checking the validity ofinformation related to start(s) of packets and/or end(s) of packets. Forexample, in the PM state 730, the FSM may send an error message if SOPbecomes 1, and the FSM may then return to the INIT/IDLE state 710. TheFSM may include performing other checks of the validity of ranges of theSPI and EPI signals. For example, in the PD state 750, the EPI and SPIsignals should indicate that the distance between the end of the datapacket and the beginning of the next data packet is equal to or largerthan a predefined inter-packet gap length.

FIG. 6 illustrates embodiments of the masking generation module 610 andthe masking modules 620; 630, and 640. When SOP=1 the mask generationmodule 610 processes the SPI signal, representing the start of packetindex i_(S), to generate a binary mask M^((S)) whose components haveindices from (S−1) to 0, i.e., corresponding to S words. The componentswith indices larger than i_(S) are zero, and the components with indicessmaller than or equal to i_(S) are one. The mask generation module 610generates the binary mask X^((S)), which indicates which words are to beinverted. In the binary mask X^((S)), components i_(S) tomax(i_(S)−m/w+1, 0) are one, and the other components are zero. If(i_(S)−m/w+1)<0, the components (S−1) to (S−(i_(S)−m/w+1)) of the binarymask X^((S)), which correspond to the next segment, are also one. Themasks M^((S)) and X^((S)) are distributed to the masking modules 620,630, and 640, and used selectively in a manner dependent on the state ofthe FSM 700.

In one embodiment, masking replaces each digital data symbol of thefirst sequence that is outside the data packet replace with zero andinverts leading and final digital data symbols of the data packet. Thezero-valued components of the mask M^((S)) identify portions of thesegment,

which are not in the data packet, and the unit-valued components of themask M^((S)) identify the portions of the first sequence, which are inthe data packet. A word of a first sequence may be selectively set tozero or left unchanged by processing the word with, w AND gatescontrolled by a corresponding component of M^((S)). If a component ofthe mask M^((S)) is zero, the AND gates replaces the corresponding wordby zero, and if the component of the mask M^((S)) is one, the AND gatesdo not change the corresponding word. Similarly, the unit-valuedcomponents of the mask X^((S)) identify portions of the segment to beinverted. A word of a first sequence is selectively set to inverted orleft unchanged by such processing with w XOR gates controlled by acorresponding component of X^((S)). If a component of the mask X^((S))is one, the XOR gate replaces the corresponding word by a ones inverse,and if the component of the mask X^((S)) is zero, the XOR gate does notchange the corresponding word.

In FIG. 5, the segment 522 of length 20 (bytes/words) enters the maskingunit 420 with information indicating that six bytes precede the start ofthe packet. For that, reason, the mask generation module 610 replacesthe first six bytes by zeros. The mask/generation module also causesbytes 7-10 of the segment to be Inverted.

Referring to FIG. 6, the combination of masking and partial remainderappending units 420, 425 may restart the remainder calculation inresponse to detecting a start of a new data packet in mask generationmodule 610. More specifically, the masking modules 620 and 630 may havemultiplexers that select between a fed back remainder and a zero inputas the fed back remainder. When the value of SOP is one, the multiplexerselects the zero input to restart the

pp.lynomi-al divisions for evaluating the sequence, for the remainderpolynomial R_(v) ^((b))(t).

Referring again to FIGS. 4A, 4B, 5 and 6, the partial remainderappending and remainder processing units 425, 440 may enable, updates ofthe non-leading segments 546, 556, 566 of the second sequence 570 byappending previously computed partial remainders 538, 548, 558 to themost significant parts thereof The calculation of each partial remainder538, 548, 558, 568 involves dividing such updated and masked segments536, 546, 556, 566 by a fixed divisor sequence, e.g., the CRC generatorpolynomial G(t), m the segment division units 430, 435. In this way, themasking unit 420, the partial remainder appending unit 425, and theremainder processing unit 440 support the calculation of the remainderfor the remainder polynomial R^((b))v(t) when a data packet stretchesacross a plurality of segments via iterative calculations on theindividual segments 536, 546, 556, 566.

For example, the remainder is computed iteratively in the example ofFIG. 5 as follows. In the first iteration, the FSM 700 enters the PBstate 720 and forms and applies the M^((S)) mask 532 and the X^((S))mask 534 to the segment 522 of the first sequence to obtain the firstmasked segment 536 of the second sequence 570. Then, the masked segment536 is processed in the segment division unit 430 to obtain the firstpartial remainder 538. In the next iteration, the FSM 700 enters the PMstate 730, and the masking unit 420 takes the next segment 524 as inputand generates the masks for the given FSM state to form the secondsegment 546, thereby forming the second segment of the second sequence570. The partial remainder 538 is fed back to the partial remainderappending unit 425 and is added to the most significant part of the nextsegment 546, after which the segment division unit 430 processes theresulting segment to determine the next partial remainder 548. In thenext iteration, the FSM 700 enters the PM state 730, and the segment 526is processed to obtain the third segment 556 of the second sequence 570in unit 420. The partial remainder 548 is fed back to the partialremainder appending unit 425 and is added to the most significant partof the next segment 556, after which the segment division unit 430processes the resulting segment to determine the next partial remainder558. In the last iteration, the FSM 700 changes to the PE state 740 andforms and applies the M^((E)) mask 562 and the X^((S)) mask 564 to thesegment 528 of the first sequence to form the last segment 566 of thesecond sequence 570. In addition, the partial remainder 558 is fed backto the partial remainder appending unit 425 and is added to the mostsignificant part of the next segment 566, after which the segmentdivision unit 430 processes the resulting segment, to determine the nextpartial remainder 568, which would be produced by dividing the maskedsecond sequence 570 by the CRC generator polynomial G(t).

The above procedure enables the segment division units 430,435 tocompute the partial remainders 538, 548, 558, 568 in the same fashionregardless of the location of the start of a data packet in the segment522 of the first sequence 510. The remainder processing unit 440 may usesignal information to determine whether an end of the packet is in asegment thereby determining whether a remainder should be output.

The mask generation module 610 may generate a bit level inversion maskX^((B)), which may also be transmitted to one or more of the maskingmodules 620, 630, 640. A bit level inversion signal may be used toinstruct the masking modules 620, 630, and 640 to perform inversions oftheir respective portions of the (m/w) most significant words of thesegment on a bit level, if the check sequence segment contained in thepacket spans two segments.

For example, in an embodiment where the last (m/w) words of the datapacket are to be inverted, bit level inversions may be employed toaccount for an end-of-packet in the first ((m/w)−1) words of thesegment. This bit level inversion is employed because one or more wordsthat should have been inverted were not inverted, because the words wereprocessed with a previous segment. While the l mask signals are shown asbeing coupled, to ail masking modules 620, 630, 640, and as having widthS, (S-H), and H, respectively, in alternate embodiments, some of the lmasks may be coupled only to those-masking modules that fail within thenumber of words to be inverted.

The S-word masking module 620, and the (S-H) word and H-word maskingmodules 630 and 640 may include multiple banks of AND gates and multiplebanks of XOR gates. The banks of AND and XOR gates function to enableword-level masking and addition of the partial remainder from line 441to the segment of the second sequence. The bank of XOR gates enableinversion of one or more of the incoming bits to the masking modules620, 630, and 640, and the banks of XOR gates enable inversion of everybit (i.e., the entire word) of the portion of the data segment 412entering the masking modules. In alternate embodiments, other logicdevices and/or structures may replace the banks of AND gates and/orbanks of XOR gates to realize such masking functions.

As described above, the masking unit 420 may mask words of a datasegment by setting words of the segment that do not belong to the packetto zero and or may ones invert one or more words at the start and/or theend of the data packet.

Referring to FIG. 5, the processing begins by receiving a segment of thefirst sequence. Next, the mask generation module 610 determines whethera new packet starts within the received segment based on the informationfrom output port 414 of the segmenting unit 410 and the current state ofthe finite state machine 700. If anew packet does start in the segment,e.g., segment 522, the masking generation module 610 may produce maskvectors to set bytes preceding the start of the new data packet and/orto invert, the first m/w words of the new data packet. In FIG. 5, thestart of the new data packet is at the seventh byte in segment 522 and,the masking generation module 610 produces mask vector M^((S)) 534 andinversion mask vector X^((S)) 536 to mask the first six words of thesegment 522 and invert words 7-10 in masking module 620.

If the received segment does not have a start of a new data packet, themasking generation module 610 -determines whether an end of the datapacket is in the segment, as indicated by state PM 730. If there is notamend of the data packet is in the received segment, the masking unit620 will not mask or invert bytes of tire segment. If, however, the datapacket does end in the received segment, the mask generation module 610determines whether the end of the packet fells within the first (m/w)−1words of the segment (PE state 740 and PD state 750).

If the end of the data packet is in the first (m/w)−1 words of thesegment, the masking unit 420 may mask the words following the end ofthe packet by setting, said words to zero and/or may invert the last(m/w) words of the data packet. In one embodiment, the masking unit 420masks words following the end of the data packet with mask M^((E)) andinverts the last (m/w) words of the data packet with mask X^((E)).

If the end of the data packet does fall within the first (m/w)−1 wordsof the data segment, then one or more bytes, which are inverted ifprocessing is according to IEEE 802.3 or other suitable standards, mayhave been previously processed without, inversion, because the end ofthe data packet did not occur in a segment containing the one or morewords that should have been inverted. Thus, if the end .of the datapacket occurs within the first (m/w)−1 words of the segment 412 (e.g.,in the PE state 740 and the PD state 750), the masking/unit 420 maskswords following the end of the packet.

Referring to FIGS. 4A-4B, the remainder processing unit 440 maycalculate the remainder for the last segment having part of the datapacket therein. In particular, in the PE and PF states 740, 760, thesegment division unit 430 will calculate the remainder for the lastsegment in the manner already described. It will be appreciated that ifthe remainder processing unit 440 feeds back partial remainders, theremainder calculated by the segment division, unit 430 for the last datasegment is the remainder for the entire data packet as well as the zerosthat replace bytes following the end of the data packet. The remainderprocessing unit 440 produces such a remainder whenever the end of apacket has been reached. If the remainder processing unit 440 does notfeed back partial remainders, the remainder processing unit 440determines the remainder polynomial at line 441 multiplied by “t^(s)”,after which the resulting remainder from this computation is added fromoutput port of the segment division unit 430 to form the sequence forthe remainder polynomial R^((b))v(t). In the PD state 750, the maskingunit 420 selects either segment division unit 430, 435 to determine theremainder of the last packet and the remainder processing unit 440selects the output of either segment division unit 430, 435 to determinethe sequence for the remainder polynomial R^((b))v(t).

The remainder polynomial R^((b))v(t) calculated from the maskedpolynomial V(t), which has extra zeros following the end of the datapacket, may differ from the CRC check, sequence polynomial R(t) for thedata packet alone.

Referring to FIG. 8, the backwards computation unit 470 is configured tobackwards compute the CRC check sequence polynomial R(t) from theremainder polynomial R^((b))v(t) by removing the effects of the trailingzeros in the masked polynomial V(t). More specifically, the backwardscomputation unit-470 includes a plurality of backward computationmodules 820-0, 820-1, . . . , 820-(p-1), wherein each computationmodules 820-0, 820-1,. . . , 820-(p-1) is configured to calculate whatthe remainder would have been if the segment containing the end of thedata packet had been shorter by a particular amount specified by controlsignal from line 445, For example, the backwards computation module820-0 is configured to calculate what the CRC. cheek sequence that wouldhave been if the polynomial division had stopped one byte before the endof the segment. Generally, the backwards computation module 820-k isconfigured to calculate what the check sequence would have been if thepolynomial division had stopped 2^(k) bytes before the end of thesegment.

The illustrated backwards computation unit 470 may include p seriallyconcatenated backward computation modules, each such module isconfigured to backwards-calculate 2^(q) bytes for distinct values of “q”satisfying 0≦q<p.

By selecting a combination of the backwards calculation modules 820-0,820-1, . . . , 820-(p-1), the backwards computation unit 470 canselectively backwards calculate the CRC check sequence polynomial R(t)from the remainder polynomial R^((b))v(t) for any value of h betweenzero and—2^(p)-1. More specifically, in the embodiment illustrated inFIG. 8, the backwards computation unit 470 includes a plurality ofmultiplexers 830-0, 830-1,. . . , 830-(p-1) which operate to activate orbypass selected backwards calculation modules 820-0, 820-1, . . . ,820-(p-1) based on the sum of the number of trailing bytes masked tozero, i.e., b. Here, the backwards calculation module 820-k is ahardware device implementing Equation (7) for δ=2^(k).

For example, if the last 7 bytes of segment 528 are masked to zero, thepacket's CRC remainder or CRC check sequence polynomial R(t) 580 isbackwards computed 7 bytes. That is, the signal at line 445 indicatesthe binary number “00111”. Thus, the multiplexers 830-0, 830-1, . . . ,830-2 corresponding to backwards calculating 1 byte, 2 bytes, and 4bytes would be activated, and the backwards calculation modules forbackwards calculating 8 bytes and 16 bytes would be bypassed to producea total backwards calculation of 7 bytes.

The above backwards computation of the remainder R(t) is feasiblebecause zeros at the end of the final masked segment deterministicallyaffect the evaluation of a remainder. For that reason, the actual CRCcheck sequence can be found from the computed remainder polynomialR^((b))v(t) and the location of the end of the data packet. Moreover,the backwards computation unit 470 can enable the segment division units430, 435 to perform remainder calculations in the same fashionregardless of the location of the end of the data packet. The segmentdivision units 430, 435 process a sequence of consecutive equal lengthsegments, which may improve the efficiency and/or decreasing the sizeand fabrication cost of the encoder 400A of FIG. 4A with respect toalternative CRC encoders that would require more parallel or serialdivision units to determine the desired remainder.

Referring again to FIG. 4A, after backward computation of a sequence forthe CRC remainder polynomial R(t), the backwards computation unit 470outputs a CRC check sequence of length m or a sequence of length m forthe previously described difference polynomial D(t) to the checksequence segment adjustment unit 480 via output port 472. The backwardscomputation unit 470 also outputs information on the-position of thereserved portion of the data packet to the check sequence segmentadjustment unit 480 via output port 474. The check sequence adjustmentunit 480 uses the position information to identify the reserved portionof the data packet in the original data stream on the delay line 469 andto produce at the output port 482 a data stream in which the reserved,portion of the corresponding data packet has the CRC check sequencetherein.

Lastly, such CRC check sequence appended data packets can be transmittedfrom the output port 482 to a communications channel via a variety ofsuitable transmitters and transmission protocols (e.g., Ethernet,Gigabit Ethernet, or Evolution Voice/Data Only).

When the data packet reaches its destination, the receiver may use thedecoder 400B of FIG. 4B to calculate a CRC remainder for the data packetfor use in identifying errors that may have occurred duringtransmission. It the received data packet is not found to be a CRCcodeword, there is a high likelihood that the one or more bits of thepacket were altered during transmission.

While the invention may be susceptible to various modifications andalternative forms,

specific embodiments have been shown by way of example in the drawingsand have been described in detail herein. However, it should beunderstood that the invention is not intended to be limited to theparticular forms disclosed. Rather, the invention is to cover allmodifications, equivalents, and alternatives Sailing within the spiritand scope of the invention as defined by the following appended claims.

1. A method of processing a data packet located in a first sequence ofdisjoint original segments, each original segment of the first sequencehaving the same length, comprising: modifying a first of the originalsegments of the first sequence by modifying one or more symbols therein,a start of a data packet being located in the first of the originalsegments and being after a first symbol therein; modifying a last of theoriginal segments of the first sequence by modifying one or more symbolstherein, an end of the data packet being located in the last of theoriginal segments and being before the last symbol therein; anddetermining a remainder by performing a polynomial division on a secondsequence of disjoint derived segments, each segment of the secondsequence corresponding to and being derived from one of the originalsegments, the segments of the second sequence having the length of theoriginal segments, a first of the derived segments of the secondsequence being the modified first of the original segments, a last ofthe derived segments of the second sequence being the modified last ofthe original segments.
 2. The method of claim 1, wherein each derivedsegment that does not include the start or end of the data packet isequal to the corresponding one of the original segments.
 3. The methodof claim 1, wherein the modifying steps include masking portions of theoriginal segments outside of the data packet such that said portionswill contribute in a predetermined amount to the remainder determined bythe polynomial division.
 4. The method of claim 1, wherein the modifyinga first of the original segments modifies symbols at the start of thedata packet.
 5. The method of claim 4, wherein the modifying stepsinclude masking portions of the original segments outside of the datapacket such that said masked portions will contribute in a predeterminedamount to the remainder determined by the polynomial division.
 6. Themethod of claim 1, wherein the modifying of a last of the originalsegments modifies symbols at the end of the data packet.
 7. The methodof claim 6, wherein the modifying steps include masking portions of theoriginal segments outside of the data packet such that said maskedportions will not contribute to the remainder determined by thepolynomial division when a cyclic redundancy check of the data packetvanishes.
 8. The method of claim 1, further comprising: producing athird sequence by performing a symbol-by-symbol subtraction of asequence of symbols from the first sequence such that a data packetlocated in the third sequence becomes a valid codeword of an errorcontrol code that is based on a polynomial division.
 9. The method ofclaim 8, wherein the sequence of symbols is found from the remainderdetermined be the performing a polynomial division on a second sequence.10. The method of claim 1, further comprising: writing an evaluatedvalue of a cyclic redundancy check for the data packet into a specificone of the segments of the first sequence in response to the end of thedata packet being in the specific one of the segments of the firstsequence.
 11. The method of claim 10, wherein the modifying furtherincludes receiving a number indicative of the location of the end of thepacket in the specific one of the segments of the first sequence; andwherein the writing includes determining a location to write theevaluated value based on the received number. 12-20. (canceled)